package graphics.complexe;

import graphics.primitive.Polygon;
import graphics.primitive.Polyline;

import javax.media.opengl.GL;

import com.sun.opengl.util.texture.Texture;

import settings.Settings;
import utils.Point3DUtil;

import mathematics.geometry.Geometry;
import mathematics.geometry.PolygonGeometry;

public class PolygonGraphicObject extends BaseGraphicObject
{
	private Geometry geometricShape;
	private Texture texture;
	
	public PolygonGraphicObject(GL gl, Geometry shape)
	{
		this.setGeometry(shape);
		this.shape = new Polygon(gl, shape);
		this.outline = new Polyline(gl, shape, 1.0f);
		PolygonGeometry selectionMath = new PolygonGeometry(Point3DUtil.computeExpandedPolygon(shape, Settings.SelectionOffset));
		selectionMath.setLoop(true);
		this.selectionShape = new Polyline(gl, selectionMath, Settings.SelectionLineWidth);
		this.selectionShape.setColor(Settings.selectionColor);
	}

	public Geometry getGeometry() {
		return geometricShape;
	}

	public void setGeometry(Geometry geometricShape) {
		this.geometricShape = geometricShape;
	}
}
